{% extends 'myhome/base.html' %}
{% block con %}
<!-- breadcrumbs-area-start -->
<div class="breadcrumbs-area mb-70">
    <div class="container">
        <div class="row">
            <div class="col-lg-12">
                <div class="breadcrumbs-menu">
                    <ul>
                        <li><a href="#">首页</a></li>
                        <li><a href="#" class="active">个人中心</a></li>
                    </ul>
                </div>
            </div>
        </div>
    </div>
</div><!-- breadcrumbs-area-end -->
<!-- entry-header-area-start -->
<div class="entry-header-area">
    <div class="container">
        <div class="row">
            <div class="col-lg-12">
                <div class="entry-header-title">
                    <h2>我的订单</h2>
                </div>
            </div>
        </div>
    </div>
</div>
<!-- entry-header-area-end -->

<div class="cart-main-area mb-70">
    <div class="container">
        <div class="row">
            <div class="col-lg-12">
                <form action="#">
                    <div class="table-content table-responsive">
                        {% for i in user.order_set.all %}
                        <table>
                            <thead>
                            <tr style="background: #E3E3E3;">
                                <th style="text-align: left;" class="product-thumbnail">
                                    订单时间:{{ i.ordertime }}
                                    &nbsp;&nbsp;&nbsp;&nbsp;
                                    订单号:{{ i.id }}
                                </th>
                                <th>订单总价:{{ i.totalprice }}</th>
                                <th>
                                    订单状态:
                                    {% if i.status == 0 %}
                                        <span style="color: red;">未支付</span>
                                    {% elif i.status == 1 %}
                                        <span style="color: green;">已支付</span>
                                    {% elif i.status == 2 %}
                                        <span>待收货</span>
                                    {% elif i.status == 3 %}
                                        <span>已取消</span>
                                    {% endif %}
                                </th>
                                <th class="product-remove">操作</th>
                            </tr>
                            </thead>
                            <tbody>
                            {% for ii in i.orderdetail_set.all %}
                            <tr>
                                <td class="product-thumbnail">
                                    <!-- i是购物车对象,bid是商品对象 -->
                                    <a href="#"><img style="width: 80px;" src="/{{ ii.bid.bookimgs_set.first.img_url }}" alt="man"/></a>
                                {{ ii.bid.title }}
                                </td>
                                {% load pagetag %}
                                <td>¥{{ ii.price }} x {{ ii.num }}</td>
                                <td>¥<span>{% cheng ii.price ii.num %}</span></td>
                                <td class="product-remove">
                                    <a href="javascript:void(0)"><i class="fa fa-times"></i></a>
                                </td>
                            </tr>
                            {% endfor %}
                            </tbody>
                        </table>
                        {% endfor %}
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>
{% endblock %}





